package com.shop.service;

import cn.hutool.core.bean.BeanUtil;

import com.shop.dao.ProductMapper;
import com.shop.dto.ProductDto;
import com.shop.dto.ProductDtoQuery;
import com.shop.entity.ProductEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wzby
 * @Date: 2022/10/21 9:58
 */
@Service
public class ProductService {
    @Autowired
    private ProductMapper productMapper;

    public List<ProductDto> select(ProductDtoQuery productDtoQuery){
        List<ProductEntity> entities = productMapper.select(productDtoQuery);
        return BeanUtil.copyToList(entities,ProductDto.class);
    }



}
